//
// Created by lxd on 2022/9/10.
//


#include "com_example_androidstart_JniTest.h"
#include <stdio.h>

JNIEXPORT jstring JNICALL Java_com_example_androidstart_JniTest_get
  (JNIEnv *env, jobject thiz){
    printf("invoke get in c++ \n");
    return env->NewStringUTF("Hello from JNI !");
  }

 JNIEXPORT jstring JNICALL Java_com_example_androidstart_JniTest_set
   (JNIEnv *env, jobject thiz, jstring string){
    printf("invoke set from c++ \n");
    char* str=(char *)env->GetStringUTFChars(string,NULL);
    printf("%s \n",str);
    env-> ReleaseStringUTFChars(string,str);
   }